<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>箭头函数案例二</title>
</head>

<body>
  <script>
    const arr = [1, 6, 9, 10, 100, 25];
    const result = arr.filter(function (item) {
      if (item % 2 === 0) {
        return true;
      } else {
        return false;
      }
    });
    console.log(result); //(3) [6, 10, 100]


    const ret = arr.filter(item => {
      if (item % 2 === 0) {
        return true;
      } else {
        return false;
      }
    });
    console.log(ret); //(3) [6, 10, 100]

    const ult = arr.filter(item => item % 2 === 0);
    console.log(ult); //(3) [6, 10, 100]
  </script>
</body>

</html>